using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using WebReference;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {

        Page.PreviousPage.FindControl("")
        
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string strResult = "";
        PaymentInfoEx paymentinfo = new PaymentInfoEx();
        paymentinfo.customerid = "CC10000537";
        paymentinfo.customer = "Jenny";
        paymentinfo.username = "admin";
        paymentinfo.externalservice = true;
        paymentinfo.cardtype = cboCardTypes.SelectedValue;
        paymentinfo.remark = "Credit Card Payment via Web Portal";
        paymentinfo.username = "CC10000000";

        PaymentService payment = new PaymentService();

        strResult = payment.TestPayment("reg",  TextBox3.Text, TextBox4.Text, double.Parse(TextBox5.Text), paymentinfo, "CC10000000");

        if (paymentinfo.resulterrorcode == 0)
        {
            Response.Write("<script type=\"text/javascript\"> " +
                                "alert('Paid by credit card transaction completed! '); " +
                                "</script>");
            Label3.Text = "Thank you! Please use the receipt# when calling customer service! <p>" + strResult;
            Label3.Visible = true;
        }
        else
        {
            Response.Write("<script type=\"text/javascript\"> " +
                                 "alert('Credit card transaction failed! '); " +
                                 "</script>");
            Label3.Text = "Credit card transaction failed! <p>" + strResult;
            Label3.Visible = true;
        }
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        PaymentService payment = new PaymentService();
        Label7.Text = payment.CheckAccount(TextBox2.Text);
    }
    protected void Button3_Click(object sender, EventArgs e)
    {
        Response.Redirect("checkaccount.aspx");

    }
}
